<template>
    <div>
        <!-- 面包屑导航区域 -->
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>工人名册管理</el-breadcrumb-item>
        </el-breadcrumb>

        <!-- 卡片视图区域 -->
        <el-card>
            <el-row :gutter="20">
                <el-col :span="6">
                    <el-input placeholder="请输入工人姓名" v-model="queryInfo.query" clearable @clear="gettableData">
                        <el-button slot="append" icon="el-icon-search" @click="gettableData"></el-button>
                    </el-input>
                </el-col>
                <el-col :span="6">
                    <el-input placeholder="请输入班组名称" v-model="queryInfo.query" clearable @clear="gettableData">
                        <el-button slot="append" icon="el-icon-search" @click="gettableData"></el-button>
                    </el-input>
                </el-col>
                <el-col :span="2">
                    <el-button class="clear-button" type="primary" @click="clear" size="mini">重置</el-button>
                </el-col>
                <el-col :span="1">
                    <el-button class="search-button" type="primary" @click="search" size="mini">查询</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="2">
                    <el-button class="xinzeng-button" type="primary" @click="xinzeng" size="mini">新建工人</el-button>
                </el-col>
                <el-col :span="2">
                    <el-button class="daoru-button" type="primary" size="mini">导入</el-button>
                </el-col>
                <el-col :span="2">
                    <el-button class="daochu-button" type="primary" size="mini">导出</el-button>
                </el-col>
                <el-col :span="1">
                    <el-button class="download-button" type="primary" size="mini">下载导入模板</el-button>
                </el-col>
            </el-row>

            <el-table :data="tableData" border stripe style="width: 100%">
                <!-- <el-table-column type="index"></el-table-column> -->
                <el-table-column label="序号" prop="unit_id" width="70">
                </el-table-column>
                <el-table-column label="姓名" prop="name" width="200">
                </el-table-column>
                <el-table-column label="班组名称" prop="banzu_name" width="100">
                </el-table-column>
                <el-table-column label="性别" prop="sex" width="100">
                </el-table-column>
                <el-table-column label="身份证号" prop="id" width="180">
                </el-table-column>
                <el-table-column label="年龄" prop="age" width="200">
                </el-table-column>
                <el-table-column label="计酬方式" prop="jichou" width="200">
                </el-table-column>
                <el-table-column label="联系方式" prop="contact_phone" width="200">
                </el-table-column>
                <el-table-column label="工资标准(元)" prop="standard" width="200">
                </el-table-column>
                <el-table-column label="工资卡号" prop="id_card" width="200">
                </el-table-column>
                <el-table-column label="开户行" prop="kaihu" width="200">
                </el-table-column>
                <el-table-column label="操作" width="150">
                    <template>
                        <el-button type="primary" icon="el-icon-edit" circle size="mini"></el-button>
                        <el-button type="danger" icon="el-icon-delete" circle size="mini"></el-button>
                    </template>
                </el-table-column>
            </el-table>

            <!-- 分页区域 -->
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="queryInfo.pagenum" :page-sizes="[1, 3, 5, 10]" :page-size="queryInfo.pagesize"
                layout="total, sizes, prev, pager, next, jumper" :total="2">
            </el-pagination>
        </el-card>
    </div>
</template>

<script>
export default{
    data() {
        return {
            tableData: [{
                unit_id: 1,
                name:<el-button type="text">dwy</el-button>,
                banzu_name:'知非工作室1组',
                sex:'女',
                id:'32937211138328',
                age:'13',
                jichou:'月',
                contact_phone: '12345678907',
                standard:'12000',
                id_card:'381327**********3892',
                kaihu:'工商银行'
            },
            {
                unit_id: 2,
                name:<el-button type="text">dwy</el-button>,
                banzu_name:'知非工作室2组',
                sex:'女',
                id:'32937211138328',
                age:'18',
                jichou:'年',
                contact_phone: '12345678907',
                standard:'160000',
                id_card:'381327**********3892',
                kaihu:'工商银行'
            }],
            queryInfo: {
                query: '',
                //当前的页数
                pagenum: 1,
                //当前每页显示多少条数据
                pagesize: 2
            },
            // userlist: [],
             total: 2
        }
    },
    created() {
        // this.getUserList()
        this.gettableData()
    },
    methods: {
        //监听pagesize改变的事件
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
            // this.queryInfo.pagesize=val
            // this.gettableData()
        },
        //监听页码值改变的事件
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        },
        xinzeng(){
            this.$router.push('/src/components/department/Xin-zeng.vue')
        },
        clear(){

        },
        search(){

        },
    }
}
</script>

<style lang="less" scoped>

.xinzeng-button{
    background-color: #909399;
    font-size: 8px;
    line-height: 8px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
}

.clear-button{
    background-color: #909399;
    font-size: 8px;
    line-height: 8px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
}

.search-button{
    background-color: #909399;
    font-size: 8px;
    line-height: 8px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
}

.download-button{
    background-color: #909399;
    font-size: 8px;
    line-height: 8px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
}

.daoru-button{
    background-color: #909399;
    font-size: 8px;
    line-height: 8px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
}

.daochu-button{
    background-color: #909399;
    font-size: 8px;
    line-height: 8px;
    color: #fff;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
}

</style>